<?php

abstract class a_base_cart_l_cart implements i_shop_l_cart {

    public function __construct() {

    }

    public function total_product_price() {
        $total = 0.0;
        if ($this->is_empty() === FALSE) {
            $items = $this->get_all_items();            
            foreach ($items as $item) {
                $product = $item->get_product();
                if ($product) {                    
                    $total+= ( $product->get_price() * $item->qty);
                }
            }
        }
        return $total;
    }

    public function  total_tax() {
        //@TO_DO
        $total = 0.0;
//        if ($this->is_empty() === FALSE) {
//            $items = $this->get_all_items();
//            foreach ($items as $item) {
//                $product = $item->get_product();
//                if ($product) {
//                    $total+= ( $product->get_price() * $item->qty);
//                }
//            }
//        }
        return $total;
    }

    public function  total_cart_price() {
        return ($this->total_product_price()+$this->total_tax()) - $this->total_discount();
    }
    public function  total_discount() {
        //@TO_DO : discount will be calculated by discount driver...
        return 0.0;
    }

}

?>